﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;

namespace JuniorProject.Models
{
    public class SearchContext : DbContext
    {
        public SearchContext()
            : base("DefaultConnection")
        {
        }
    }

    public class SearchModel
    {
        public SearchModel(int ID, int PostingID, string Title, string Description, string Location,
                            DateTime InsertDate, DateTime? ModifiedDate)
        {
            this.ID = ID;
            this.PostingID = PostingID;
            this.Title = Title;
            this.Description = Description;
            this.Location = Location;
            this.InsertDate = InsertDate;
            this.ModifiedDate = ModifiedDate;
        }

        [Display(Name = "JobID")]
        public int ID { get; set; }

        [Display(Name = "JobPostingID")]
        public int PostingID { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "Job Title")]
        public string Title { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "Job Description")]
        public string Description { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "Location")]
        public string Location { get; set; }

        [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}")]
        [Display(Name = "Posting Date")]
        public DateTime InsertDate { get; set; }

        [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}")]
        [Display(Name = "Modified Date")]
        public DateTime? ModifiedDate { get; set; }
    }
}
